import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
import java.util.Scanner;


public class ReadFile {

	public static void main(String[] args) throws IOException {
			File path = new File(".");
		    final String[] list;
		    if(args.length == 0)
		      list = path.list();
		    else 
		list = path.list(new DirFilter(args[0]));
		for(int i = 0; i < list.length; i++)
		 System.out.println(list[i]);
			
	/**	  System.out.println("Find key: " + 
		    args[0] + " in file: " + );
	 try
		{
		  LineNumberReader lnr =  new LineNumberReader(
		      new BufferedReader(
		       new FileReader(args[1])));
	
		String s;
		while(true)
		{
		  s = lnr.readLine();
		  if(s == null)
		    break;
		            
		  if(s.indexOf(args[0]) != -1)  
		  {
		    System.out.println("<<< " + 
		      lnr.getLineNumber() + " >>>" + s);
		  }  
		
		
		
		}  
		lnr.close();
	 }
	finally {
				
	}
	**/
	}}
		